//
//  ViewController.swift
//  TextSpeak
//
//  Created by nhope on 2017/9/8.
//  Copyright © 2017年 nhope. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var textView: UITextView!
    private let speech = Speech()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func speakButtonAction(_ sender: UIButton) {
        guard let text = textView.text else { return }
        speech.speak(text)
    }
    
}

